package com.javalong.affairs.module.renwujinzhang.activity.praise;

import android.content.Intent;
import android.os.Bundle;
import android.widget.EditText;

import com.javalong.affairs.R;
import com.javalong.affairs.base.activity.UIHandlerActivity;
import com.javalong.affairs.base.constant.BundleKey;
import com.javalong.affairs.base.ui.TopTitle;
import com.javalong.affairs.base.ui.TopTitle.OnLeftDrawableClick;
import com.javalong.affairs.base.ui.TopTitle.OnRightTextClick;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ContentView;
import com.lidroid.xutils.view.annotation.ViewInject;

@ContentView(R.layout.activity_editcontent_praise)
public class PraiseEditContentActivity extends UIHandlerActivity {
    @ViewInject(R.id.ui_toptitle)
    private TopTitle topTitle;
    @ViewInject(R.id.et_content)
    private EditText et_content;
    public String editConetnt;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ViewUtils.inject(this);
        initData();
        initUI();
    }

    private void initData() {
    }

    private void initUI() {
        topTitle.setOnLeftDrawableClick(new OnLeftDrawableClick() {

            @Override
            public void leftClick() {
                finish();
            }
        });
        topTitle.setOnRightTextClick(new OnRightTextClick() {
            @Override
            public void rightTextClick() {
                finishEdit();
            }
        });
    }

    private void finishEdit() {
        Intent intent = new Intent();
        intent.putExtra(BundleKey.EDITCONTENT, et_content.getText().toString());
        setResult(RESULT_OK, intent);
        finish();
    }
}
